class BannerService:
    def __init__(self, banner_repository):
        self.banner_repository = banner_repository

    def get_all_banners(self) -> (int, list[dict]):
        banners = self.banner_repository.get_all_banners()
        total = len(banners)
        return {
            "total": total,
            "banners": [
                {"title": banner.title, "img_url": banner.img_url, "link": banner.link}
                for banner in banners
            ],
        }
